package org.example.admin.service.impl;

import org.example.admin.dao.RoleMenuDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.example.admin.service.RoleMenuService;

import java.util.List;


@Service("roleMenuService")
public class RoleMenuServiceImpl implements RoleMenuService {

    @Autowired
    private RoleMenuDao roleMenuDao;

    @Override
    public int saveRoleAuthority(Long id, List<Long> permissionId) {
        return roleMenuDao.saveRoleAuthority(id, permissionId);
    }

    @Override
    public List<Long> getAuthorityByRoleId(Long id) {
        return roleMenuDao.getAuthorityByRoleId(id);
    }

    @Override
    public void deleteByRoleId(List<Long> ids) {
        roleMenuDao.deleteByRoleId(ids);
    }

    @Override
    public void deleteByMenuId(List<Long> ids) {
        roleMenuDao.deleteByMenuId(ids);
    }
}